<h1>Student Attendance Generator</h1>

<form method="post" action="${currentPath}">
<p>
	<label for="studentId">Student: </label>
	<select id="studentId" name="studentId">
		
		<#list students as student>
			<#if student.id == studentId>
				<option selected="selected" value="${student.id?c}">${student.id?c} - ${student.firstName} ${student.lastName}</option>
			<#else>
				<option value="${student.id?c}">${student.id?c} - ${student.firstName} ${student.lastName}</option>
			</#if>
		</#list>
	</select>
</p>
<p>
	<input type="submit" value="Generate" />
</p>
</form>

<div>
<#if attendants?has_content>
<table>
	<thead>
		<tr>
			<th>Id</th>
			<th>Sesssion Name</th>
			<th>Course Name</th>
			<th>Status</th>
		</tr>
	</thead>
	<tbody>
		<#list attendants as attendant>
			<tr>
				<td>${attendant.id}</td>
				<td>${attendant.sessionName}</td>
				<td>${attendant.courseName}</td>
				<td>${attendant.statusName}</td>
			</tr>
		</#list>
	</tbody>
</table>
</#if>
</div>